package com.common;

public class ServiceMessage<T> {
    
    private int status;
    
    private String message; 
    
    private T date;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getDate() {
        return date;
    }

    public void setDate(T date) {
        this.date = date;
    }

    public ServiceMessage(int status, String message, T date) {
        super();
        this.status = status;
        this.message = message;
        this.date = date;
    }

    public ServiceMessage() {
        super();
    }
    
    public static <T> ServiceMessage<T> ok() {
        return ServiceMessage.ok(null);
    }
    
    public static <T> ServiceMessage<T> ok(T date) {
        return new ServiceMessage<T>(200,"ok",date);
    }
    
    public static <T> ServiceMessage<T> error() {
        return new ServiceMessage<T>(500,"error",null);
    }
}
